package com.admin.kotlintest.adapter

import android.content.Context
import com.admin.kotlintest.R
import com.admin.kotlintest.base.AdapterHolder
import com.admin.kotlintest.base.CurrencyAdapter
import com.admin.kotlintest.bean.MyUser
import com.admin.kotlintest.custome.CircleImageView
import com.admin.kotlintest.utils.ImageUtils

/**
 * Created by 吴昶 on 2018/4/17.
 */
class UserListAdapter(context: Context,layout:Int,data:MutableList<MyUser>?):CurrencyAdapter<MyUser>(context,layout,data){

    override fun convert(holder: AdapterHolder, item: MyUser, position: Int) {
        var circleImageView=holder.getCircleImageView(R.id.civ_user_header)
        item.header?.let {
            ImageUtils.GlideLoadImage(context,item.header!!.fileUrl,circleImageView,R.mipmap.ic_launcher_round,R.mipmap.ic_launcher_round)
        }
        item.header?:let {
            circleImageView!!.setImageResource(R.mipmap.ic_launcher_round)
        }
        holder.setTextViewText(R.id.tv_user_name,item.username)
    }
}